const p1 = new Promise((resolve, reject) => {
    resolve("ok")
})

const res = p1.then(res => {
    console.log(res)
}, reason => {
    console.log(reason)
})

console.log(res)